<?php

/**
 * Created by PhpStorm.
 * User: 志俊
 * Date: 2015/5/13 0013
 * Time: 9:00
 */
class Smileys extends CI_Controller
{

    function __construct()
    {
        parent::__construct();
    }

    function index()
    {
        $this->load->helper('smiley');
        $this->load->library('table');

        $image_array = get_clickable_smileys(constant("FCPATH") . '/public/image/smileys/', 'editor');
        $tmpl = array(
            'table_open' => '<table border="0" cellpadding="4" cellspacing="0" class="table">',

            'heading_row_start' => '<tr>',
            'heading_row_end' => '</tr>',
            'heading_cell_start' => '<th>',
            'heading_cell_end' => '</th>',

            'row_start' => '<tr>',
            'row_end' => '</tr>',
            'cell_start' => '<td>',
            'cell_end' => '</td>',

            'row_alt_start' => '<tr>',
            'row_alt_end' => '</tr>',
            'cell_alt_start' => '<td>',
            'cell_alt_end' => '</td>',

            'table_close' => '</table>'
        );
        $this->table->set_template($tmpl);
        $col_array = $this->table->make_columns($image_array, 8);

        $data = $this->table->generate($col_array);

        echo $data;
    }

}
